{include file="public/header" /}
<body style="padding-top: 0">
<ul class="draw-to-list" style="margin-bottom: 3.5rem;">
    <li data-type="{if $user.bank_number}bank{/if}">
        <div class="top">
            <p class="flex-center">
                <img src="/static/admin/img/bank.png" alt="">
            </p>
            <p class="center">{:get_pay_way('bank')}</p>
            <label for="check1">
                <img src="/static/index/img/icon6.png" alt="">
            </label>
            <input type="radio" id="check1">
        </div>
        <div class="news">
            <p>银行：{$user.bank_name?:'未绑定'}</p>
            <p>卡号：{:strreplace($user.bank_number)}</p>
        </div>
    </li>
    <li data-type="{if $user.wechat_name && $user.wechat_image}wechat{/if}">
        <div class="top">
            <p class="flex-center">
                <img src="/static/admin/img/wechat.png" alt="">
            </p>
            <p class="center">{:get_pay_way('wechat')}</p>
            <label for="check2">
                <img src="/static/index/img/icon6.png" alt="">
            </label>
            <input type="radio" id="check2">
        </div>
        <div class="news">
            <p>姓名：{:substrCut($user.wechat_name)}</p>
        </div>
    </li>
    <li data-type="{if $user.alipay_name && $user.alipay_image}alipay{/if}">
        <div class="top">
            <p class="flex-center">
                <img src="/static/admin/img/alipay.png" alt="">
            </p>
            <p class="center">{:get_pay_way('alipay')}</p>
            <label for="check3">
                <img src="/static/index/img/icon6.png" alt="">
            </label>
            <input type="radio" id="check3">
        </div>
        <div class="news">
            <p>姓名：{:substrCut($user.alipay_name)}</p>
        </div>
    </li>
</ul>
<p class="save save-fixed">管理收款方式</p>
</body>
{include file="public/footer" /}
<script>
    $(function () {
        $('.draw-to-list li').click(function () {
            $(this).find('label img').attr('src', '/static/index/img/icon7.png');
            $(this).siblings().find('label img').attr('src', '/static/index/img/icon6.png');
            var type = $(this).attr('data-type');
            switch (type) {
                case "bank":
                    parent.renderLoad(type, '/static/admin/img/bank.png', '{:get_pay_way(\'bank\')}（{:strreplace($user.bank_number)}）');
                    break;
                case "wechat":
                    parent.renderLoad(type, '/static/admin/img/wechat.png', '{:get_pay_way(\'wechat\')}（{:substrCut($user.wechat_name)}）');
                    break;
                case "alipay":
                    parent.renderLoad(type, '/static/admin/img/alipay.png', '{:get_pay_way(\'alipay\')}（{:substrCut($user.alipay_name)}）');
                    break;
                default:
                    layer.msg('请先完善后在使用');
            }
        });
        $('.save').click(function () {
            parent.location.href = '{:url("user/methodList")}';
        });
    });
</script>
</html>